package com.peoit.honeycomb.dto;

import com.peoit.honeycomb.domain.User;

import java.util.List;

/**
 * Created by Bing.Zeng on 2015/9/23.
 */
public class UserDto extends BaseDto {
	// 用户名（昵称）
	private String userName;
	// 邮箱
	private String email;
	// 手机
	private String phoneNumber;
	// 登录密码
	private String password;
	// 授权密码
	private String authorizationCode;
	// 用户头像
	private String avatar;
	// 用户等级
	private String level;
	// 用户简介
	private String userCaption;
	// 用户是否实名验证
	private String isRealNameValidated;
	// 用户真实姓名
	private String userRealName;
	// 固定资产
	private String fixedAssets;;
	// 年收益
	private String annualEarning;
	// 用户身份证号码
	private String idNumber;
	// 紧急联系人姓名
	private String emergencyContactPersonName;
	// 紧急联系人号码
	private String emergencyContactPersonNumber;
	// 身份证正面图片路径
	private String idCardFrontFile;
	// 身份证反面图片 路径
	private String idCardBackFile;

	// 验证码
	private String verifyCode;

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getPhoneNumber() {
		return phoneNumber;
	}

	public void setPhoneNumber(String phoneNumber) {
		this.phoneNumber = phoneNumber;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getAuthorizationCode() {
		return authorizationCode;
	}

	public void setAuthorizationCode(String authorizationCode) {
		this.authorizationCode = authorizationCode;
	}

	public String getAvatar() {
		return avatar;
	}

	public void setAvatar(String avatar) {
		this.avatar = avatar;
	}

	public String getLevel() {
		return level;
	}

	public void setLevel(String level) {
		this.level = level;
	}

	public String getUserCaption() {
		return userCaption;
	}

	public void setUserCaption(String userCaption) {
		this.userCaption = userCaption;
	}

	public String getIsRealNameValidated() {
		return isRealNameValidated;
	}

	public void setIsRealNameValidated(String isRealNameValidated) {
		this.isRealNameValidated = isRealNameValidated;
	}

	public String getVerifyCode() {
		return verifyCode;
	}

	public void setVerifyCode(String verifyCode) {
		this.verifyCode = verifyCode;
	}

	public String getUserRealName() {
		return userRealName;
	}

	public void setUserRealName(String userRealName) {
		this.userRealName = userRealName;
	}

	public String getFixedAssets() {
		return fixedAssets;
	}

	public void setFixedAssets(String fixedAssets) {
		this.fixedAssets = fixedAssets;
	}

	public String getIdCardBackFile() {
		return idCardBackFile;
	}

	public void setIdCardBackFile(String idCardBackFile) {
		this.idCardBackFile = idCardBackFile;
	}

	public String getIdCardFrontFile() {
		return idCardFrontFile;
	}

	public void setIdCardFrontFile(String idCardFrontFile) {
		this.idCardFrontFile = idCardFrontFile;
	}

	public String getEmergencyContactPersonNumber() {
		return emergencyContactPersonNumber;
	}

	public void setEmergencyContactPersonNumber(String emergencyContactPersonNumber) {
		this.emergencyContactPersonNumber = emergencyContactPersonNumber;
	}

	public String getEmergencyContactPersonName() {
		return emergencyContactPersonName;
	}

	public void setEmergencyContactPersonName(String emergencyContactPersonName) {
		this.emergencyContactPersonName = emergencyContactPersonName;
	}

	public String getIdNumber() {
		return idNumber;
	}

	public void setIdNumber(String idNumber) {
		this.idNumber = idNumber;
	}

	public String getAnnualEarning() {
		return annualEarning;
	}

	public void setAnnualEarning(String annualEarning) {
		this.annualEarning = annualEarning;
	}

	// ===============================================assembler====================
	public static User toUser(UserDto dto) {
		User user = new User();

		user.setId(dto.getId());
		user.setUserName(dto.getUserName());
		user.setEmail(dto.getEmail());

		user.setAuthorizationCode(dto.getAuthorizationCode());
		user.setPassword(dto.getPassword());
		user.setPhoneNumber(dto.getPhoneNumber());
		user.setAvatar(dto.getAvatar());

		user.setLevel(dto.getLevel());
		user.setUserCaption(dto.getUserCaption());

		user.setUserRealName(dto.getUserRealName());
		user.setIsRealNameValidated(dto.getIsRealNameValidated());

		user.setFixedAssets(dto.getFixedAssets());
		user.setAnnualEarning(dto.getAnnualEarning());
		user.setIdNumber(dto.getIdNumber());
		user.setEmergencyContactPersonName(dto.getEmergencyContactPersonName());
		user.setEmergencyContactPersonNumber(dto.getEmergencyContactPersonNumber());
		user.setIdCardFrontFile(dto.getIdCardFrontFile());
		user.setIdCardBackFile(dto.getIdCardBackFile());

		;

		return user;
	}

	public static UserDto toDto(User user) {
		UserDto dto = new UserDto();

		dto.setId(user.getId());
		dto.setUserName(user.getUserName());
		dto.setEmail(user.getEmail());
		dto.setAuthorizationCode(user.getAuthorizationCode());
		dto.setPassword(user.getPassword());
		dto.setPhoneNumber(user.getPhoneNumber());
		dto.setAvatar(user.getAvatar());
		dto.setIsRealNameValidated(user.getIsRealNameValidated());
		dto.setLevel(user.getLevel());
		dto.setUserCaption(user.getUserCaption());
		dto.setUserRealName(user.getUserRealName());

		return dto;
	}

	public List<UserDto> UserListPage(List<User> result) {

		return null;
	}
}
